package apiday01;

/*
    返回当前字符串指定位置上的字符
    charAt(int index)
 */

public class CharAtDemo {
    public static void main(String[] args) {
        String str = "thinking in java";
        char c = str.charAt(3);//获取str中下标为3的字符
        System.out.println(c);

        String s1 = "";
        for (int i = 0; i < str.length(); i++) {
            char c1 = str.charAt(i);
            s1 += c1;
            System.out.println(s1);
        }
        System.out.println(s1);
    }
}
